Don't leave page->tab_label dangling. (gtk_notebook_real_remove): Use
authorMatthias Clasen <mclasen@redhat.com>
Tue, 21 Mar 2006 00:12:48 +0000 (00:12 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 21 Mar 2006 00:12:48 +0000 (00:12 +0000)
2006-03-20  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtknotebook.c (gtk_notebook_remove_tab_label): Don't leave
page->tab_label dangling.
(gtk_notebook_real_remove): Use GTK_IN_DESTRUCTION.
(gtk_notebook_destroy): Leave the removal of the children
to the container destroy method.  (#319032, Yevgen Muntyan)

2006-03-20  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkcombobox.c (gtk_combo_box_remove): Use the existing
GTK_IN_DESTRUCTION flag, rather than roll our own.

ChangeLog
ChangeLog.pre-2-10
gtk/gtkcombobox.c
gtk/gtknotebook.c

index 4ef68f03ee122c89df268be9b2ab0eadbf4b72c4..2c099fbf5a4c00939c1076a105225a129a69814d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2006-03-20  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtknotebook.c (gtk_notebook_remove_tab_label): Don't leave
+       page->tab_label dangling.
+       (gtk_notebook_real_remove): Use GTK_IN_DESTRUCTION.
+       (gtk_notebook_destroy): Leave the removal of the children
+       to the container destroy method.  (#319032, Yevgen Muntyan)
+
+2006-03-20  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_remove): Use the existing
+       GTK_IN_DESTRUCTION flag, rather than roll our own.
+
+2006-03-20  Matthias Clasen  <mclasen@redhat.com>
+       
        * gtk/gtk.symbols: 
        * gtk/gtkscrolledwindow.h: 
        * gtk/gtkscrolledwindow.c: Add a window-placement-set property
index 4ef68f03ee122c89df268be9b2ab0eadbf4b72c4..2c099fbf5a4c00939c1076a105225a129a69814d 100644 (file)
@@ -1,5 +1,18 @@
 2006-03-20  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtknotebook.c (gtk_notebook_remove_tab_label): Don't leave
+       page->tab_label dangling.
+       (gtk_notebook_real_remove): Use GTK_IN_DESTRUCTION.
+       (gtk_notebook_destroy): Leave the removal of the children
+       to the container destroy method.  (#319032, Yevgen Muntyan)
+
+2006-03-20  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_remove): Use the existing
+       GTK_IN_DESTRUCTION flag, rather than roll our own.
+
+2006-03-20  Matthias Clasen  <mclasen@redhat.com>
+       
        * gtk/gtk.symbols: 
        * gtk/gtkscrolledwindow.h: 
        * gtk/gtkscrolledwindow.c: Add a window-placement-set property
index e8f4de5ed4ce3d4f332c8226ea7fe0acabada9c1..4548720e78c24f2d8c6c618f6cdf3eacd8aa215f 100644 (file)
@@ -111,7 +111,6 @@ struct _GtkComboBoxPrivate
 
   guint popup_in_progress : 1;
   guint popup_shown : 1;
-  guint destroying : 1;
   guint add_tearoffs : 1;
   guint has_frame : 1;
   guint is_cell_renderer : 1;
@@ -1060,7 +1059,7 @@ gtk_combo_box_remove (GtkContainer *container,
   gtk_widget_unparent (widget);
   GTK_BIN (container)->child = NULL;
 
-  if (combo_box->priv->destroying)
+  if (GTK_OBJECT_FLAGS (combo_box) & GTK_IN_DESTRUCTION)
     return;
 
   gtk_widget_queue_resize (GTK_WIDGET (container));
@@ -4956,12 +4955,8 @@ gtk_combo_box_destroy (GtkObject *object)
   combo_box->priv->row_separator_data = NULL;
   combo_box->priv->row_separator_destroy = NULL;
 
-  combo_box->priv->destroying = 1;
-
   GTK_OBJECT_CLASS (parent_class)->destroy (object);
   combo_box->priv->cell_view = NULL;
-
-  combo_box->priv->destroying = 0;
 }
 
 static void
index 2b970b99a750e0acf3cc07e1d3b269bb56780157..9dd499b3d58210ac81d575d751ac4900c60b6806 100644 (file)
@@ -304,8 +304,7 @@ static gint gtk_notebook_real_insert_page    (GtkNotebook      *notebook,
 static void gtk_notebook_redraw_tabs         (GtkNotebook      *notebook);
 static void gtk_notebook_redraw_arrows       (GtkNotebook      *notebook);
 static void gtk_notebook_real_remove         (GtkNotebook      *notebook,
-                                             GList            *list,
-                                             gboolean          destroying);
+                                             GList            *list);
 static void gtk_notebook_update_labels       (GtkNotebook      *notebook);
 static gint gtk_notebook_timer               (GtkNotebook      *notebook);
 static gint gtk_notebook_page_compare        (gconstpointer     a,
@@ -1257,22 +1256,12 @@ gtk_notebook_new (void)
 static void
 gtk_notebook_destroy (GtkObject *object)
 {
-  GList *children;
   GtkNotebook *notebook = GTK_NOTEBOOK (object);
   GtkNotebookPrivate *priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
   
   if (notebook->menu)
     gtk_notebook_popup_disable (notebook);
 
-  children = notebook->children;
-  while (children)
-    {
-      GList *child = children;
-      children = child->next;
-      
-      gtk_notebook_real_remove (notebook, child, TRUE);
-    }
-
   if (priv->source_targets)
     {
       gtk_target_list_unref (priv->source_targets);
@@ -3183,7 +3172,7 @@ gtk_notebook_remove (GtkContainer *container,
                 widget,
                 page_num);
 
-  gtk_notebook_real_remove (notebook, children, FALSE);
+  gtk_notebook_real_remove (notebook, children);
 }
 
 static gboolean
@@ -3735,18 +3724,22 @@ gtk_notebook_remove_tab_label (GtkNotebook     *notebook,
 
       gtk_widget_set_state (page->tab_label, GTK_STATE_NORMAL);
       gtk_widget_unparent (page->tab_label);
+      page->tab_label = NULL;
     }
 }
 
 static void
 gtk_notebook_real_remove (GtkNotebook *notebook,
-                         GList       *list,
-                         gboolean     destroying)
+                         GList       *list)
 {
   GtkNotebookPage *page;
   GList * next_list;
   gint need_resize = FALSE;
 
+  gboolean destroying;
+
+  destroying = GTK_OBJECT_FLAGS (notebook) & GTK_IN_DESTRUCTION;
+  
   next_list = gtk_notebook_search_page (notebook, list, STEP_PREV, TRUE);
   if (!next_list)
     next_list = gtk_notebook_search_page (notebook, list, STEP_NEXT, TRUE);